<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Serve\LoginServe;
use Exception;
use Illuminate\Http\Request;

class LoginController extends BaseController
{
    public function __construct(Request $request)
    {
        $this->serve = new LoginServe($request);
    }

    /**
     * @throws Exception
     */
    public function normal(Request $request): \Illuminate\Http\JsonResponse
    {
        if (!$this->serve->isLogin()){
            $this->serve->normal($request->all());
        }
        return $this->successMessage(trans('user.LOGIN_SUCCESS',[],$request->getLocale()));
    }

    public function email(Request $request)
    {

    }
}
